package com.xdemo.community.msg;

import com.xdemo.core.MessageType;
import com.xdemo.core.msg.BreakServerMessage;
import com.xdemo.core.msg.RegisterServerMessage;
import com.xdemo.core.msg.TestExchangeMessage;
import com.xdemo.msg.BaseMessage;
import com.xdemo.msg.IMessageRecognizer;

public class CommunityMessageRecognizer implements IMessageRecognizer<Integer,Integer> {

	@Override
	public BaseMessage createMessage(Integer type) {
		switch(type) {
		case MessageType.TestExchange:
			return new TestExchangeMessage();
		case MessageType.RegisterServer:
			return new RegisterServerMessage();
		case MessageType.BreakServer:
			return new BreakServerMessage();
		}
		return null;
	}

}
